package hh.util.time;

import java.util.concurrent.TimeUnit;

public class Tunit {
    TimeUnit unit;
    int value;

    public Tunit(int value, TimeUnit unit) {
        this.unit = unit;
        this.value = value;
    }

    public long getMillis() {
        return unit.toMillis(value);
    }
    public long getSeconds() {
        return unit.toSeconds(value);
    }
    public long getMinutes() {
        return unit.toMinutes(value);
    }
    public long getHours() {
        return unit.toHours(value);
    }
    public long getDays() {
        return unit.toDays(value);
    }

    @Override
    public String toString() {
        return "{" + value + " " + unit +
                '}';
    }
}
